function sleep1(ms){
    var timeStamp = new Date().getTime();
    var endTime = timeStamp + ms;
    while(true){
        if (new Date().getTime() > endTime){
            return;
        }
    }
}

function sleep2(ms) {
    return new Promise((resolve) => setTimeout(resolve, ms));
}

module.exports.sleep1 = sleep1;
module.exports.sleep2 = sleep2;
